package com.coderman.youpinshop.stock.controller;

import com.coderman.youpinshop.stock.service.StockService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Description:
 * date: 2022/1/15
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@RestController
public class StockController {

    @Resource(name = "commonStockService")
    private StockService commonStockService;

    @Resource(name = "dDDStockService")
    private StockService dddStockService;

    @Resource(name = "highBloodStockService")
    private StockService highBloodStockService;


    @RequestMapping(value = "/stock/deduct/common")
    public Boolean deductCommon(String stockCode, Integer deductCount){
        return commonStockService.deduct(stockCode, deductCount);
    }

    @RequestMapping(value = "/stock/deduct/ddd")
    public Boolean deductDDD(String stockCode, Integer deductCount){
        return dddStockService.deduct(stockCode, deductCount);
    }


    @RequestMapping(value = "/stock/deduct/highblood")
    public Boolean deductHighBlood(String stockCode, Integer deductCount){
        return highBloodStockService.deduct(stockCode, deductCount);
    }




}
